<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Keyed Data Lists</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
<link rel="prev" href="glib-Quarks.html" title="Quarks">
<link rel="next" href="glib-Datasets.html" title="Datasets">
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="glib.html" title="GLib Overview">
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
<link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
<link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
<link rel="chapter" href="tools.html" title="GLib Tools">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-Quarks.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-data-types.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Datasets.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3410020" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id3410393" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="glib-Keyed-Data-Lists"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3410020"></a><span class="refentrytitle">Keyed Data Lists</span>
</h2>
<p>Keyed Data Lists &#8212; lists of data elements which are accessible by a string or GQuark identifier</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;glib.h&gt;


                    <a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a>;
void                <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-init">g_datalist_init</a>                     (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist);

#define             <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-set-data">g_datalist_id_set_data</a>              (dl, q, d)
void                <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-set-data-full">g_datalist_id_set_data_full</a>         (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy_func);
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-get-data">g_datalist_id_get_data</a>              (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id);
#define             <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-remove-data">g_datalist_id_remove_data</a>           (dl, q)
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-remove-no-notify">g_datalist_id_remove_no_notify</a>      (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id);

#define             <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-set-data">g_datalist_set_data</a>                 (dl, k, d)
#define             <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-set-data-full">g_datalist_set_data_full</a>            (dl, k, d, f)
#define             <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-get-data">g_datalist_get_data</a>                 (dl, k)
#define             <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-remove-data">g_datalist_remove_data</a>              (dl, k)
#define             <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-remove-no-notify">g_datalist_remove_no_notify</a>         (dl, k)

void                <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-foreach">g_datalist_foreach</a>                  (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Datasets.html#GDataForeachFunc">GDataForeachFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
void                <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-clear">g_datalist_clear</a>                    (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist);
void                <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-set-flags">g_datalist_set_flags</a>                (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> flags);
void                <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-unset-flags">g_datalist_unset_flags</a>              (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> flags);
<a class="link" href="glib-Basic-Types.html#guint">guint</a>               <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-get-flags">g_datalist_get_flags</a>                (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist);
#define             <a class="link" href="glib-Keyed-Data-Lists.html#G-DATALIST-FLAGS-MASK:CAPS">G_DATALIST_FLAGS_MASK</a>
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3410393"></a><h2>Description</h2>
<p>
Keyed data lists provide lists of arbitrary data elements which can be accessed
either with a string or with a <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> corresponding to the
string.
</p>
<p>
The <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> methods are quicker, since the strings have to be converted to
<span class="type">GQuarks</span> anyway.
</p>
<p>
Data lists are used for associating arbitrary data with
<span class="type">GObjects</span>, using <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-set-data"
><code class="function">g_object_set_data()</code></a> and related functions.
</p>
<p>
To create a datalist, use <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-init"><code class="function">g_datalist_init()</code></a>.
</p>
<p>
To add data elements to a datalist use <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-set-data"><code class="function">g_datalist_id_set_data()</code></a>,
<a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-set-data-full"><code class="function">g_datalist_id_set_data_full()</code></a>, <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-set-data"><code class="function">g_datalist_set_data()</code></a>
and <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-set-data-full"><code class="function">g_datalist_set_data_full()</code></a>.
</p>
<p>
To get data elements from a datalist use <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-get-data"><code class="function">g_datalist_id_get_data()</code></a> and
<a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-get-data"><code class="function">g_datalist_get_data()</code></a>.
</p>
<p>
To iterate over all data elements in a datalist use <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-foreach"><code class="function">g_datalist_foreach()</code></a> (not thread-safe).
</p>
<p>
To remove data elements from a datalist use <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-remove-data"><code class="function">g_datalist_id_remove_data()</code></a> and
<a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-remove-data"><code class="function">g_datalist_remove_data()</code></a>.
</p>
<p>
To remove all data elements from a datalist, use <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-clear"><code class="function">g_datalist_clear()</code></a>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3410608"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3410618"></a><h3>
<a name="GData"></a>GData</h3>
<a class="indexterm" name="id3410631"></a><pre class="programlisting">typedef struct _GData GData;</pre>
<p>
The <a class="link" href="glib-Keyed-Data-Lists.html#GData"><span class="type">GData</span></a> struct is an opaque data structure to represent a
<a class="link" href="glib-Keyed-Data-Lists.html" title="Keyed Data Lists">Keyed Data List</a>.
It should only be accessed via the following functions.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3410664"></a><h3>
<a name="g-datalist-init"></a>g_datalist_init ()</h3>
<a class="indexterm" name="id3410676"></a><pre class="programlisting">void                g_datalist_init                     (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist);</pre>
<p>
Resets the datalist to <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
It does not free any memory or call any destroy functions.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>datalist</code></em>&#160;:</span></p></td>
<td>a pointer to a pointer to a datalist.


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3410735"></a><h3>
<a name="g-datalist-id-set-data"></a>g_datalist_id_set_data()</h3>
<a class="indexterm" name="id3410748"></a><pre class="programlisting">#define             g_datalist_id_set_data(dl, q, d)</pre>
<p>
Sets the data corresponding to the given <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id.
Any previous data with the same key is removed, and its
destroy function is called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dl</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>q</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> to identify the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>d</code></em>&#160;:</span></p></td>
<td>the data element, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to remove any previous element
corresponding to <em class="parameter"><code>q</code></em>.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3410844"></a><h3>
<a name="g-datalist-id-set-data-full"></a>g_datalist_id_set_data_full ()</h3>
<a class="indexterm" name="id3410858"></a><pre class="programlisting">void                g_datalist_id_set_data_full         (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy_func);</pre>
<p>
Sets the data corresponding to the given <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id, and the function to
be called when the element is removed from the datalist.
Any previous data with the same key is removed, and its
destroy function is called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>datalist</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_id</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> to identify the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>the data element or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to remove any previous element
corresponding to <em class="parameter"><code>key_id</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy_func</code></em>&#160;:</span></p></td>
<td>the function to call when the data element is removed. This
function will be called with the data element and can be used to free any
memory allocated for it. If <em class="parameter"><code>data</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then <em class="parameter"><code>destroy_func</code></em> must
also be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411042"></a><h3>
<a name="g-datalist-id-get-data"></a>g_datalist_id_get_data ()</h3>
<a class="indexterm" name="id3411054"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_datalist_id_get_data              (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id);</pre>
<p>
Retrieves the data element corresponding to <em class="parameter"><code>key_id</code></em>. 
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>datalist</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_id</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> identifying a data element.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the data element, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if it is not found.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411159"></a><h3>
<a name="g-datalist-id-remove-data"></a>g_datalist_id_remove_data()</h3>
<a class="indexterm" name="id3411172"></a><pre class="programlisting">#define             g_datalist_id_remove_data(dl, q)</pre>
<p>
Removes an element, using its <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> identifier.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dl</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>q</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> identifying the data element.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411236"></a><h3>
<a name="g-datalist-id-remove-no-notify"></a>g_datalist_id_remove_no_notify ()</h3>
<a class="indexterm" name="id3411250"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_datalist_id_remove_no_notify      (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id);</pre>
<p>
Removes an element, without calling its destroy notification function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>datalist</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_id</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> identifying a data element.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the data previously stored at <em class="parameter"><code>key_id</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411355"></a><h3>
<a name="g-datalist-set-data"></a>g_datalist_set_data()</h3>
<a class="indexterm" name="id3411369"></a><pre class="programlisting">#define             g_datalist_set_data(dl, k, d)</pre>
<p>
Sets the data element corresponding to the given string identifier.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dl</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string to identify the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>d</code></em>&#160;:</span></p></td>
<td>the data element, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to remove any previous element
corresponding to <em class="parameter"><code>k</code></em>.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411448"></a><h3>
<a name="g-datalist-set-data-full"></a>g_datalist_set_data_full()</h3>
<a class="indexterm" name="id3411461"></a><pre class="programlisting">#define             g_datalist_set_data_full(dl, k, d, f)</pre>
<p>
Sets the data element corresponding to the given string identifier, and the
function to be called when the data element is removed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dl</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string to identify the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>d</code></em>&#160;:</span></p></td>
<td>the data element, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to remove any previous element corresponding to
<em class="parameter"><code>k</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>f</code></em>&#160;:</span></p></td>
<td>the function to call when the data element is removed. This
function will be called with the data element and can be used to free any
memory allocated for it. If <em class="parameter"><code>d</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then <em class="parameter"><code>f</code></em> must also be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411590"></a><h3>
<a name="g-datalist-get-data"></a>g_datalist_get_data()</h3>
<a class="indexterm" name="id3411603"></a><pre class="programlisting">#define             g_datalist_get_data(dl, k)</pre>
<p>
Gets a data element, using its string identifer.
This is slower than <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-id-get-data"><code class="function">g_datalist_id_get_data()</code></a> because the string is first
converted to a <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dl</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string identifying a data element.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the data element, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if it is not found.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411692"></a><h3>
<a name="g-datalist-remove-data"></a>g_datalist_remove_data()</h3>
<a class="indexterm" name="id3411706"></a><pre class="programlisting">#define             g_datalist_remove_data(dl, k)</pre>
<p>
Removes an element using its string identifier.
The data element's destroy function is called if it has been set.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dl</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string identifying the data element.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411755"></a><h3>
<a name="g-datalist-remove-no-notify"></a>g_datalist_remove_no_notify()</h3>
<a class="indexterm" name="id3411769"></a><pre class="programlisting">#define             g_datalist_remove_no_notify(dl, k)</pre>
<p>
Removes an element, without calling its destroy notifier.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dl</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string identifying the data element.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411818"></a><h3>
<a name="g-datalist-foreach"></a>g_datalist_foreach ()</h3>
<a class="indexterm" name="id3411831"></a><pre class="programlisting">void                g_datalist_foreach                  (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Datasets.html#GDataForeachFunc">GDataForeachFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
<p>
Calls the given function for each data element of the datalist.
The function is called with each data element's <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id and data,
together with the given <em class="parameter"><code>user_data</code></em> parameter.
Note that this function is NOT thread-safe. So unless <em class="parameter"><code>datalist</code></em>
can be protected from any modifications during invocation of this
function, it should not be called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>datalist</code></em>&#160;:</span></p></td>
<td>a datalist.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
<td>the function to call for each data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
<td>user data to pass to the function.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3411947"></a><h3>
<a name="g-datalist-clear"></a>g_datalist_clear ()</h3>
<a class="indexterm" name="id3411960"></a><pre class="programlisting">void                g_datalist_clear                    (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist);</pre>
<p>
Frees all the data elements of the datalist.
The data elements' destroy functions are called if they have been set.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>datalist</code></em>&#160;:</span></p></td>
<td>a datalist.


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3412009"></a><h3>
<a name="g-datalist-set-flags"></a>g_datalist_set_flags ()</h3>
<a class="indexterm" name="id3412025"></a><pre class="programlisting">void                g_datalist_set_flags                (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> flags);</pre>
<p>
Turns on flag values for a data list. This function is used
to keep a small number of boolean flags in an object with
a data list without using any additional space. It is
not generally useful except in circumstances where space
is very tight. (It is used in the base <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
><span class="type">GObject</span></a> type, for
example.)</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>datalist</code></em>&#160;:</span></p></td>
<td> pointer to the location that holds a list
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em>&#160;:</span></p></td>
<td> the flags to turn on. The values of the flags are
  restricted by <a class="link" href="glib-Keyed-Data-Lists.html#G-DATALIST-FLAGS-MASK:CAPS"><code class="literal">G_DATALIST_FLAGS_MASK</code></a> (currently
  3; giving two possible boolean flags).
  A value for <em class="parameter"><code>flags</code></em> that doesn't fit within the mask is
  an error.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since  2.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3412137"></a><h3>
<a name="g-datalist-unset-flags"></a>g_datalist_unset_flags ()</h3>
<a class="indexterm" name="id3412152"></a><pre class="programlisting">void                g_datalist_unset_flags              (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> flags);</pre>
<p>
Turns off flag values for a data list. See <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-unset-flags"><code class="function">g_datalist_unset_flags()</code></a></p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>datalist</code></em>&#160;:</span></p></td>
<td> pointer to the location that holds a list
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em>&#160;:</span></p></td>
<td> the flags to turn off. The values of the flags are
  restricted by <a class="link" href="glib-Keyed-Data-Lists.html#G-DATALIST-FLAGS-MASK:CAPS"><code class="literal">G_DATALIST_FLAGS_MASK</code></a> (currently
  3: giving two possible boolean flags).
  A value for <em class="parameter"><code>flags</code></em> that doesn't fit within the mask is
  an error.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since  2.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3412262"></a><h3>
<a name="g-datalist-get-flags"></a>g_datalist_get_flags ()</h3>
<a class="indexterm" name="id3412277"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint">guint</a>               g_datalist_get_flags                (<a class="link" href="glib-Keyed-Data-Lists.html#GData">GData</a> **datalist);</pre>
<p>
Gets flags values packed in together with the datalist.
See <a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-set-flags"><code class="function">g_datalist_set_flags()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>datalist</code></em>&#160;:</span></p></td>
<td> pointer to the location that holds a list
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> the flags of the datalist

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since  2.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3412356"></a><h3>
<a name="G-DATALIST-FLAGS-MASK:CAPS"></a>G_DATALIST_FLAGS_MASK</h3>
<a class="indexterm" name="id3412370"></a><pre class="programlisting">#define G_DATALIST_FLAGS_MASK 0x3
</pre>
<p>
A bitmask that restricts the possible flags passed to
<a class="link" href="glib-Keyed-Data-Lists.html#g-datalist-set-flags"><code class="function">g_datalist_set_flags()</code></a>. Passing a flags value where
flags &amp; ~G_DATALIST_FLAGS_MASK != 0 is an error.</p>
<p>

</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3412405"></a><div class="refsect2" lang="en"><a name="id3412406"></a></div>
<hr>
<div class="refsect2" lang="en"><a name="id3412408"></a></div>
</div>
</div>
</body>
</html>
